//
//  STProductContendViw.m
//  CuiBoStore
//
//  Created by 崔博 on 16/12/11.
//  Copyright © 2016年 崔博. All rights reserved.
//

#import "STProductContendViw.h"
#import "STProdataListModel.h"
@implementation STProductContendViw

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self == [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}


#pragma mark - set
- (void)setListArray:(NSArray *)listArray
{
    _listArray = listArray;
    CGFloat height = 0;
    for (STProdataListModel *m in listArray) {
        UILabel *labl = [STUIKitTools lableFont:12 textColor:[UIColor blackColor] text:m.Title];
        labl.frame = CGRectMake(15, height, 60, 12);
        [self addSubview:labl];
        CGFloat maxHeight = [m.Value heightForFont:[UIFont systemFontOfSize:13] width:SCREEN_WIDTH - 190];
        UILabel *conten = [STUIKitTools lableFont:12 textColor:[UIColor blackColor] text:m.Value];
        conten.numberOfLines = 0;
        conten.frame = CGRectMake(75, height, SCREEN_WIDTH - 190, maxHeight);
        [self addSubview:conten];
        height = maxHeight + height + 15;
    };
    if (self.block) {
        self.block(height);
    }
}
@end
